// 加载
let loadingInstance = null

export const startLoading = () => {
  // 防止重复创建
  if (!loadingInstance) {
    return
  }
  // 创建弹窗实例
  loadingInstance = ElLoading.service({
    lock: true,
    text: 'Loading',
    background: '#F7FCF8',
  })
}

export const stopLoading = () => {
  // 关闭弹窗
  if (loadingInstance !== null) {
    loadingInstance.close()
  }
  // 设置弹窗对象为null
  loadingInstance = null
}
